#include("../_inc/_layout.html" )
#@layout(user.nickname + "的首页 - Jboot Fly", null, null,"user")
#define content()

<div class="fly-home fly-panel" style="background-image: url();">
  <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" alt="贤心">
  <h1>
    #(user.nickname)
  </h1>

  <p style="padding: 10px 0; color: #5FB878;">
    #if(user.auth_info)
    认证信息：#(user.auth_info)
    #end
  </p>

  <p class="fly-home-info">
    <i class="layui-icon" style="color: #FF7200;">&#xe62b;</i>  <span style="color: #FF7200;">#(user.point ?? 0 ) 元宝</span>
    <i class="iconfont icon-shijian"></i><span>#date(user.created,"yyyy-MM-dd") 加入</span>
    <i class="iconfont icon-chengshi"></i><span>博客：#(user.site ?? "没有填写")</span>
  </p>

  <p class="fly-home-sign">个人签名：#(user.signature ?? "（这个家伙觉得签名不重要...所以没有填写）")</p>

  <div class="fly-sns" data-user="">
    <a href="javascript:;" class="layui-btn layui-btn-primary fly-imActive" data-type="addFriend">加为好友</a>
    <a href="javascript:;" class="layui-btn layui-btn-normal fly-imActive" data-type="chat">发起会话</a>
  </div>

</div>

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md6 fly-home-jie">
      <div class="fly-panel">
        <h3 class="fly-panel-title">#(user.nickname) 最近的发布</h3>
        <ul class="jie-row">

          #if(posts)
          #for(post : posts)
          <li>
            <span class="fly-jing">精</span>
            <a href="/post/#(post.id)" class="jie-title"> #(post.title)</a>
            <i>刚刚</i>
            <em class="layui-hide-xs">#(post.view_count ?? 0 )阅 / #(post.comment_count ?? 0 )答</em>
          </li>
          #end
          #end

          <!-- <div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;"><i style="font-size:14px;">没有发表任何求解</i></div> -->
        </ul>
      </div>
    </div>
    
    <div class="layui-col-md6 fly-home-da">
      <div class="fly-panel">
        <h3 class="fly-panel-title">#(user.nickname) 最近的动态</h3>
        <ul class="home-jieda">

          #if(userActions)
          #for(userAction : userActions)

            #if(userAction.action == "new_comment")
            <li>
              <p>
              <span>#date(userAction.created,"yyyy-MM-dd")</span>
              在<a href="/post/#(userAction.post_id ??)" target="_blank">#(userAction.post.title)</a>中回答：
              </p>
              <div class="home-dacontent">
                #(userAction.comment.content ?? )
              </div>
            </li>
            #elseif(userAction.action == "sign_in")
            <li>
              <p>
                <span>#date(userAction.created,"yyyy-MM-dd")</span>
                进行签到了，获得了5个元宝。
              </p>
            </li>
            #elseif(userAction.action == "new_post")
            <li>
              <p>
                <span>#date(userAction.created,"yyyy-MM-dd")</span>
                发布了帖子<a href="/post/#(userAction.post_id ??)" target="_blank">#(userAction.post.title)</a>，打赏 #(userAction.point) 个元宝。
              </p>
            </li>
            #elseif(userAction.action == "comment_adopted")
            <li>
              <p>
                <span>#date(userAction.created,"yyyy-MM-dd")</span>
               在帖子<a href="/post/#(userAction.post_id ??)" target="_blank">#(userAction.post.title ?? "（文章可能已经被删除）")</a>，回答被采纳了，获得 #(userAction.point)元宝。
              </p>
            </li>
            #elseif(userAction.action == "finished_post")
            <li>
              <p>
                <span>#date(userAction.created,"yyyy-MM-dd")</span>
                结帖了<a href="/post/#(userAction.post_id ??)" target="_blank">#(userAction.post.title ?? "（文章可能已经被删除）" )</a>，获得 #(userAction.point)元宝。
              </p>
            </li>
            #end
          #end
          #end



          <!-- <div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;"><span>没有回答任何问题</span></div> -->
        </ul>
      </div>
    </div>
  </div>
</div>

#end